import React, { PureComponent } from 'react'
import { connect } from 'react-redux'
import { changeBannersAction } from '../store/actionCreators';
// import axios from 'axios';
export class category extends PureComponent {

    componentDidMount() {
        const b = ['a', 'b', 'c']
        console.log("🚀 ~ category ~ componentDidMount ~ b:", b)
        this.props.changeBanners(b)
    }

    render() {
        return (
            <div>
                <h2>
                    category
                </h2>
            </div>
        )
    }

}

const mapStateToProps = (state) => {
    return {
        counter: state.counter,
        banners: state.banners
    }
}

const mapDispatchToProps = (dispatch) => ({
    changeBanners(banners) {
        dispatch(changeBannersAction(banners))
    }
})

export default connect(mapStateToProps, mapDispatchToProps)(category);

